﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using System.Windows;




namespace WpfPropertyGrid
{
    public class ListTypeEditor : TypeEditor
    {

        public ListTypeEditor(Type editedType, object inlineTemplate):base(editedType,inlineTemplate)
        {

 
        }


        public override void ShowDialog(PropertyItemValue propertyValue, System.Windows.IInputElement commandSource)
        {

            if (propertyValue == null) return;


            //在这里定义list 的包装


            List<object> o = propertyValue.Value as List<object>;


            Type td =propertyValue.ParentProperty.PropertyType.GetGenericTypeDefinition();
            if (td == typeof(List<>))
            {
                Type[] typeParameters = propertyValue.ParentProperty.PropertyType.GetGenericArguments();

                //通过反射构建具体的类型


               // List<td.DeclaringType>


            }




           // MessageBox.Show("ok!");

        }

    }
}
